#ifndef __SCREEN_H
#define __SCREEN_H
#include "SDL.h"
#include "View.h"
#include "Thread.h"
#include <vector>
class Screen
{
public:
	static void Init();
	static bool IsReady();
	static void ShowView(const View *pView);
	static void ShowImage(const Image *pImage);
	static void DrawRect(Rect<S32> *pRect, U8 nRed, U8 nGreen, U8 nBlue);
	static void DrawPointVector(std::vector < Point <S32> > * pVec, U8 nRed, U8 nGreen, U8 nBlue, 
	                            S32 nThickness);
	static S32 Width() { return m_pSurface->w; }
	static S32 Height() { return m_pSurface->h; }
	template <class T> 
	static void GetImageOrViewDrawRect(T *pSomething, Rect<S32> *pRect)
	{
		pSomething->GetBoundingRect(pRect);
		S32 nWidth = pRect->Width(), nHeight = pRect->Height(); 
		pRect->SetLeftTopWidthHeight(m_pSurface->w / 2 - nWidth / 2,
	                                     m_pSurface->h / 2 - nHeight / 2,
	                                     nWidth, nHeight);
	}
private:
	static void DrawRectNoSync(Rect<S32> *pRect, U8 nRed, U8 nGreen, U8 nBlue);
	static SDL_Surface *m_pSurface;
	static Mutex m_lockSurface;
};
#endif

